﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="axios.js" type="text/javascript"></script>
</head>
<body>
    <input type="text" id="api" />
    <input type="text" id="json" />
    <input type="button" value="确定" onclick="confirm()" />
    <script>
        function confirm(){
            var json = document.getElementById("json").value;
            var api = document.getElementById("api").value;
            var _json = JSON.parse(json);
            axios({
                baseUrl: "",
                url:api,
                type:'post',
                data: _json
            }).then(data => {
                console.log(data);
            }).catch(message => {
                console.log("异常:",message);
            });
        }
        
    </script>
</body>
</html>
